<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@include file="/WEB-INF/jsp/common/navigationRight.jsp" %>
<%@include file="/WEB-INF/jsp/common/head.jsp" %>
<%@include file="/WEB-INF/jsp/common/navigationLeft.jsp" %>


<div class="m2-userCentermanage-con">
    <div class="m2-user-recharge">
        <h3><i class="m2-user-record"></i>还款计划</h3>
    </div>
    <div class="m2-manage-search-selector">
        <ul class="m2-manageSearchsel-time">
            <li class="m2-manageSearchsel-link">
                <span <c:if test="${status == 0 || status == null}">class="m2-manSealink-sel"</c:if><c:if test="${status != 0}">class="m2-manSealink-unsel"</c:if>>全部</span>
            </li>
            <li class="m2-manageSearchsel-link">
                <span <c:if test="${status == 3}">class="m2-manSealink-sel"</c:if><c:if test="${status != 3}">class="m2-manSealink-unsel"</c:if>>还款中</span>
            </li>
            <li class="m2-manageSearchsel-link">
                <span <c:if test="${status == 4}">class="m2-manSealink-sel"</c:if><c:if test="${status != 4}">class="m2-manSealink-unsel"</c:if>>已还清</span>
            </li>
        </ul>
    </div>
    <form style="display: none" method="post" action="${pageContext.request.contextPath }/borrow/list">
        <input type="text" value="${ps.currentPageNo}" name="currentPageNo"/>
        <input type="text" value="${status}" name="status"/>
    </form>
    <div class="m2-recharge-mainbody">
        <div class="m2-user-newsmanage">
            <table cellpadding="0" cellspacing="0" border="0">
                <tr>
                    <td>项目</td>
                    <td>计划还款总额(元)</td>
                    <td>实际还款总额(元)</td>
                    <td>待还款(元)</td>
                    <td>状态</td>
                    <td>详细</td>
                </tr>
                <c:forEach items="${aqbProjects}" var="aqbProject">
                    <tr>
                        <td>${aqbProject.proName}</td>
                        <td title="其中本金:${aqbProject.proAmount}元 | 利息:${aqbProject.payableInterest}元">
                                ${aqbProject.proAmount + aqbProject.payableInterest}元
                        </td>
                        <td title="其中本金:${aqbProject.payMoneySum}元 | 利息:${aqbProject.payInterestSum}元">
                                ${aqbProject.payMoneySum + aqbProject.payInterestSum}元
                        </td>
                        <td title="其中本金:${aqbProject.proAmount - aqbProject.payMoneySum}元 | 利息:${aqbProject.payableInterest - aqbProject.payInterestSum}元">
                                ${(aqbProject.proAmount - aqbProject.payMoneySum) + (aqbProject.payableInterest - aqbProject.payInterestSum)}元
                        </td>
                        <td>
                            <c:if test="${aqbProject.proStatus == 3}">还款中</c:if>
                            <c:if test="${aqbProject.proStatus == 4}">已还清</c:if>
                        </td>
                        <td><a href="${ctx}/borrow/info?proId=${aqbProject.proId}" style="color: #00BBEE">查看</a></td>
                    </tr>
                </c:forEach>
                <tr>
                    <td>总计</td>
                    <td title="其中本金:<fmt:formatNumber maxFractionDigits="2" value="${userAmountSum}" type="number" pattern="0.00"></fmt:formatNumber>元 | 利息:<fmt:formatNumber maxFractionDigits="2" value="${userInterestSum}" type="number" pattern="0.00"></fmt:formatNumber>元">
                        <fmt:formatNumber maxFractionDigits="2" value="${userAmountSum + userInterestSum}" type="number" pattern="0.00"></fmt:formatNumber>元
                    </td>
                    <td title="其中本金:<fmt:formatNumber maxFractionDigits="2" value="${userPayAmount}" type="number" pattern="0.00"></fmt:formatNumber>元 | 利息:<fmt:formatNumber maxFractionDigits="2" value="${userPayInterest}" type="number" pattern="0.00"></fmt:formatNumber>元">
                        <fmt:formatNumber maxFractionDigits="2" value="${userPayAmount + userPayInterest}" type="number" pattern="0.00"></fmt:formatNumber>元
                    </td>
                    <td title="其中本金:<fmt:formatNumber maxFractionDigits="2" value="${userAmountSum - userPayAmount}" type="number" pattern="0.00"></fmt:formatNumber>元 | 利息:<fmt:formatNumber maxFractionDigits="2" value="${userInterestSum - userPayInterest}" type="number" pattern="0.00"></fmt:formatNumber>元">
                        <fmt:formatNumber maxFractionDigits="2" value="${(userAmountSum - userPayAmount) + (userInterestSum - userPayInterest)}" type="number" pattern="0.00"></fmt:formatNumber>元
                    </td>
                </tr>
            </table>
            <div class="page-bar">
                <ul class="page-num-ul clearfix">
                    <li>共${ps.totalCount }条记录&nbsp;&nbsp; ${ps.currentPageNo}/${ps.totalPageCount} 页</li>
                    <c:if test="${ps.currentPageNo > 1 }">
                        <a href="javascript:page_nav(document.forms[0],1);">首页</a>
                        <a href="javascript:page_nav(document.forms[0],${ps.currentPageNo - 1 });">上一页</a>
                    </c:if>
                    <c:if test="${ps.currentPageNo < ps.totalPageCount }">
                        <a href="javascript:page_nav(document.forms[0],${ps.currentPageNo + 1 });">下一页</a>
                        <a href="javascript:page_nav(document.forms[0],${ps.totalPageCount });">最后一页</a>
                    </c:if>
                    &nbsp;&nbsp;
                </ul>
                <span class="page-go-form"><label>跳转至</label>
                <input type="hidden" id="totalPageCount" value="${ps.totalPageCount}"/>
	            <input type="text" name="inputPage" id="inputPage" class="page-key"/>页

	            <button type="button" class="page-btn" onClick='jump_to(document.forms[0],document.getElementById("inputPage").value)'>GO</button>
		        </span>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath }/statics/aqbjs/borrow/rollpage.js"></script>
</div>
</body>
</html>